import { Controller, Post, Body, Get, Query, Param } from '@nestjs/common';
import { SsdService } from './ssd.service';

@Controller('ssd')
export class SsdController {
  constructor(private readonly ssdService: SsdService) {}

  @Post('/info')
  createSsdInfo(@Body() body) {
    return this.ssdService.createSsdInfo(body);
  }

  @Get('/info')
  getSsdInfo(@Query() query) {
    return this.ssdService.getSsdInfo(query);
  }

  @Get('/info/:id')
  getSsdInfoById(@Param('id') id: string) {
    return this.ssdService.getSsdInfoById(id);
  }

  //修改Ssd信息
  @Post('/info/:id')
  updateSsdInfo(@Param('id') id: string, @Body() body: any) {
    return this.ssdService.updateSsdInfo(id, body);
  }

  //删除Ssd信息
  @Post('/info/delete/:id')
  deleteSsdInfo(@Param('id') id: string) {
    return this.ssdService.deleteSsdInfo(id);
  }

  //请求所有Ssd信息
  @Get('/total')
  getTotal() {
    return this.ssdService.getAllSsdInfo();
  }
}
